package com.train.mgr.modules.biz.dto.request;

import com.train.mgr.modules.system.dto.request.groups.Insert;
import com.train.mgr.modules.system.dto.request.groups.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author cxg
 * @desc UserPageReqDTO
 * @date 2024/03/09 18:05
 **/
@Data
public class EmployeeReqDTO implements Serializable {
    /**
     * 用户id
     */
    @ApiModelProperty(name = "id", value = "用户id")
    @NotNull(message = "用户id必填", groups = {Update.class})
    private Long id;
    /**
     * 用户名
     */
    @ApiModelProperty(name = "username", value = "用户名")
    @NotBlank(message = "用户名必填", groups = {Insert.class, Update.class})
    @Length(max = 10, message = "用户名长度必须在{max}以内", groups = {Insert.class, Update.class})
    private String username;
    /**
     * 密码
     */
    @ApiModelProperty(name = "pass", value = "用户密码")
   // @NotBlank(message = "用户密码必填", groups = {Insert.class})
   // @Length(max = 20,min = 6,message = "输入的账号或密码错误！", groups = {Insert.class, Update.class})
    private String pass;

    /**
     * 用户姓名
     */
    @ApiModelProperty(name = "nickName", value = "用户姓名")
    @NotBlank(message = "用户姓名必填", groups = {Insert.class, Update.class})
    @Length(max = 10, message = "用户姓名长度必须在{max}以内", groups = {Insert.class, Update.class})
    private String nickName;

    @ApiModelProperty(name = "userLable", value = "用户标签")
    private String userLable;

    /**
     * 状态：1禁用、0启用
     */
    @ApiModelProperty(name = "enabled", value = "状态：1禁用、0启用")
    @NotNull(message = "状态必填", groups = {Insert.class, Update.class})
    @Range(min = 0, max = 1, message = "状态必须在{min}-{max}范围内", groups = {Insert.class, Update.class})
    private Integer enabled;

}
